<template>
    <view class="mine">
         <uv-cell-group>
              <uv-cell icon="empty-permission" size="large" @click="clearUser" title="退出登录" ></uv-cell>
          </uv-cell-group>
    </view>
  </template>  
  
  <script setup lang="ts">  
  const app = getApp()
  import { ref ,  getCurrentInstance} from 'vue'
  import { useUCenterStore } from '@/stores/uCenter'
  import { onLoad } from "@dcloudio/uni-app"
  import local from "@/utils/local";
  const store = useUCenterStore()
  
  const clearUser = () => {
      local.deleteCache('memberInfo')
      store.$patch((state) => {
        state.memberInfo = {}
      })
      local.setCache('isCheckOutLogin',true)
      uni.showToast({
        icon:'success',
        title:'退出成功'
      })
      uni.navigateBack()
  }

  onLoad(async () => {
      const { proxy } = getCurrentInstance();
      await proxy.$onLaunched;
  })
  </script>
  <style lang="scss">
  .mine{
      margin:0 auto;
      height:100%;
      .uv-cell-group{
          flex: 1;
          width: 90%;
          margin: 32rpx auto;
          background: #fff;
          border-radius: 9px;
          box-shadow: 0 0 12rpx rgba(0,0,0,.1);
          .uv-cell-group__wrapper{
              .uv-line:first-child{border:0 !important;}
              .uv-cell:last-child{
                  .uv-line{border:0 !important;}
              }
          }
          .uv-cell__body{
              padding:32rpx;
          }
      }
  }
  </style>